<template>
  <view class="page flex-col">
    <view class="group_3">
      <view class="section_1 flex-row mt-6">
        <view class="box_1 flex-row flex-col ">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt  ml_20">期望职位:</text>
            <nut-input class="wp100 noborder" v-model="detail.position" placeholder="必填项" />
          </view>
        </view>
      </view>
      <view class="section_1 flex-row mt-6 nf">
        <view class="box_1 flex-row">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt  ml_20">期望城市:</text>
            <nut-input class="wp100 noborder" v-model="detail.city" placeholder="必填项" />
          </view>
        </view>
      </view>

      <view class="section_1 flex-row mt-6">
        <view class="box_1 flex-row">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt  ml_20">期望专业:</text>
            <nut-input class="wp100 noborder" v-model="detail.industry" placeholder="必填项" />
          </view>
        </view>
      </view>

      <view class="section_1 flex-row mt-6">
        <view class="box_1 flex-row">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt  ml_20">期望描述:</text>
            <nut-input class="wp100 noborder" v-model="detail.descriptions" placeholder="必填项" />
          </view>
        </view>
      </view>

    

      <view class="section_13 flex-row justify-between">
        <view class="text-wrapper_5 border flex-col" @click="cancel">
          <text class="text_11">取消</text>
        </view>
        <view class="text-wrapper_6 flex-col" @click="save">
          <text class="text_12">保存</text>
        </view>
      </view>
     
    </view>
  </view>
</template>

<script setup lang="ts">
import '@/static/common.less';
import './index.less';
import { getCurrentInstance, reactive, ref, toRaw ,markRaw} from 'vue';
import Taro, {
  useLoad,
  useDidShow,
  usePullDownRefresh,
  useReachBottom,
  useShareAppMessage,
  useShareTimeline,
  useTitleClick,
} from '@tarojs/taro';
import { showerr, geyDay } from '@/utils/common';

import { CategoryType, getCategoriesApi } from '@/api/categories';
import ProtoList from '@/components/proto-list/index.vue';
// import LoadMoreBottom from '@/components/load-more-bottom/index.vue';
import { getProtoListApi, ProtoType } from '@/api/proto';
import SimpleTabs from '@/components/simple-tabs/index.vue';
const container2 = ref(null);

// const windowInfo = Taro.getWindowInfo();
// const { proxy } = getCurrentInstance();
let query = ref({
  page: 1,
  limit: 6,
  category_id: '',
  sort_by: '',
  keywords: '',
});
  
let detail = reactive({
  id:-1,
  position:"",
  city:"",
  industry:"",
  descriptions:""
})
let  seekdetail = Taro.getStorageSync('seekdetail');
if(seekdetail){
  Taro.removeStorageSync('seekdetail');
  let data = JSON.parse(seekdetail)
  detail = data
}

const save = () => {
  let obj = toRaw(detail); 
  let bool = false;
  for (const key in obj) {
    if (bool) break;
    if ((typeof obj[key] =='string'&&obj[key] === '')||(typeof obj[key] =='number'&&obj[key] <0&&key != 'id')) bool = true;
  }
  if (bool)
    return Taro.showToast({
      title: '请输入完整参数',
      icon: 'none',
      duration: 500,
    });
  Taro.setStorageSync('seeksave', JSON.stringify(obj));
  Taro.navigateBack();
};
const cancel = () => {
  Taro.getStorageSync('seeksave') && Taro.removeStorageSync('seeksave');
  Taro.navigateBack();
};


</script>
